// Camera Scene Node
// (c) jimon game studio

#ifndef JEH_CCAMERASCENENODE
#define JEH_CCAMERASCENENODE

#include "ICameraSceneNode.h"

namespace je
{
	namespace scene
	{
		// Camera Scene Node
		class CCameraSceneNode:public je::scene::ICameraSceneNode
		{
		protected:
			CameraOptions Options;
			ViewportOptions Viewport;

			jeFrustum * Frustum;

			u1 NeedToRebuildProjMat;
			jeMatrix4f ProjMat;

			u1 NeedToRebuildViewMat;
			jeMatrix4f ViewMat;

		public:
			//! Constructor
			CCameraSceneNode(video::IRender * Render);

			//! Destructor
			~CCameraSceneNode();

			//! Apply Transforms
			void ApplyTransforms();

			//! Get Frustum
			jeFrustum * GetFrustum();

			//! Set Camera Options
			void SetCameraOptions(const CameraOptions & Options);

			//! Get Camera Options
			const CameraOptions & GetCameraOptions();

			//! Set Viewport Options
			void SetViewportOptions(const ViewportOptions & Options);

			//! Get Viewport Options
			const ViewportOptions & GetViewportOptions();

			//! Rebuild Transformations
			virtual void RebuildTransformations();

			//! Build Absolute Model Matrix
			virtual void BuildAbsoluteModelMatrix(const jeMatrix4f & ParentMatrix,const jeVector3df & ParentScale,u1 Changed);

			//! Serialize
			void Serialize(core::ISerializeStream * SerializeStream);

			//! Get Node Type Name
			jeStringc GetNodeTypeName()
			{
				return jeStringc("CameraSceneNode");
			}
		};
	}
}

#endif
